package com.mmc.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 角色菜单关联数据访问层
 *
 * @author kunfe
 * @since 2024-01-01
 */
@Mapper
public interface RoleMenuMapper extends BaseMapper<Object> {

    /**
     * 根据角色ID删除菜单关联
     */
    int deleteByRoleId(@Param("roleId") Long roleId);

    /**
     * 批量删除角色菜单关联
     */
    int batchDeleteByRoleIds(@Param("roleIds") List<Long> roleIds);

    /**
     * 批量插入角色菜单关联
     */
    int batchInsert(@Param("roleId") Long roleId, @Param("menuIds") List<Long> menuIds);

    /**
     * 根据角色ID查询菜单ID列表
     */
    List<Long> selectMenuIdsByRoleId(@Param("roleId") Long roleId);

    /**
     * 根据菜单ID删除角色关联
     */
    int deleteByMenuId(@Param("menuId") Long menuId);
} 